package com.sh.data.engine.application.model.dto.integration;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author: mengzheng.mhc
 * @date: 2024/6/13 11:12
 */
@EqualsAndHashCode(callSuper = true)
@Schema
@Data
public class DataSourceDetailDTO extends DataSourceDTO {

    @Schema(description = "连接参数")
    private String connectionProperty;

    @Schema(description = "账号")
    private String username;

    @Schema(description = "密码")
    private String password;

    private String dbName;

    private HiveConfig hiveConfig;

    private MongoConfig mongoConfig;

    private HDFSConfig hdfsConfig;

    private MaxComputeConfig maxComputeConfig;

    private RdbmsConfig rdbmsConfig;

    @Data
    @Schema
    public static class RdbmsConfig {
        @Schema(description = "数据库名称")
        private String dbName;

        @Schema(description = "端口")
        private Integer port;

        @Schema(description = "服务器名称")
        private String server;

        @Schema(description = "版本")
        private String version;

        @Schema(description = "oracle数据库连接类型 0-sid 1-service name ")
        private Integer oracleConnectionType;

        @Schema(description = "pg视图")
        private String schema;
    }

    @Data
    public static class HiveConfig {
        @Schema(description = "数据库名称")
        private String dbName;

        @Schema(description = "端口")
        private Integer port;

        @Schema(description = "服务器名称")
        private String server;

        private String version;
        private String hiveSiteAddress;
        private String originalFilename;
    }

    @Data
    public static class MongoConfig {
        private String authDbName;

        @Schema(description = "端口")
        private String port;

        @Schema(description = "服务器名称")
        private String server;
    }

    @Data
    public static class HDFSConfig {

        /**
         * hdfs的用户
         */
        private String server;

        private Integer port;
    }

    @Data
    public static class MaxComputeConfig {
        private String accessId;

        /**
         * accessKey
         */
        private String accessKey;

        /**
         * 项目
         */
        private String project;

        /**
         * endPoint
         */
        private String endPoint;

        /**
         * endPoint
         */
        private String tunnelEndPoint;
    }
}
